package DataStructureAndAlgorithm.CSP.Day02;
import java.util.*;
public class AcWing_3197 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int res = 0;
        int[] nums = new int[n + 1];
        HashMap<Integer,Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++){
            nums[i] = in.nextInt();
            if (nums[i] >= 0){
                map.put(nums[i],nums[i]);
            }
        }
        for (int i = 0; i < n; i++){
            if (nums[i] <= 0 && map.containsKey(-nums[i])){
                res++;
            }
        }
        System.out.print(res);
    }
}
